\(\int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 65 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=-\frac {b c d}{2 x}-\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}+i b c^2 d \log (x)-i b c^2 d \log (i+c x) \]

[Out]

-1/2*b*c*d/x-1/2*d*(1+I*c*x)^2*(a+b*arctan(c*x))/x^2+I*b*c^2*d*ln(x)-I*b*c^2*d*ln(I+c*x)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {37, 4992, 12, 78} \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=-\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}+i b c^2 d \log (x)-i b c^2 d \log (c x+i)-\frac {b c d}{2 x} \]

[In]

Int[((d + I*c*d*x)*(a + b*ArcTan[c*x]))/x^3,x]

[Out]

-1/2*(b*c*d)/x - (d*(1 + I*c*x)^2*(a + b*ArcTan[c*x]))/(2*x^2) + I*b*c^2*d*Log[x] - I*b*c^2*d*Log[I + c*x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 4992

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((f_.)*(x_))^(m_.)*((d_.) + (e_.)*(x_))^(q_.), x_Symbol] :> With[{u = I
ntHide[(f*x)^m*(d + e*x)^q, x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[SimplifyIntegrand[u/(1 + c^2*x^
2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, q}, x] && NeQ[q, -1] && IntegerQ[2*m] && ((IGtQ[m, 0] && IGtQ[q, 0
]) || (ILtQ[m + q + 1, 0] && LtQ[m*q, 0]))

Rubi steps \begin{align*} \text {integral}& = -\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}-(b c) \int \frac {d (-i+c x)}{2 x^2 (i+c x)} \, dx \\ & = -\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}-\frac {1}{2} (b c d) \int \frac {-i+c x}{x^2 (i+c x)} \, dx \\ & = -\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}-\frac {1}{2} (b c d) \int \left (-\frac {1}{x^2}-\frac {2 i c}{x}+\frac {2 i c^2}{i+c x}\right ) \, dx \\ & = -\frac {b c d}{2 x}-\frac {d (1+i c x)^2 (a+b \arctan (c x))}{2 x^2}+i b c^2 d \log (x)-i b c^2 d \log (i+c x) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.04 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.35 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=-\frac {d (a+b \arctan (c x))}{2 x^2}-\frac {i c d (a+b \arctan (c x))}{x}-\frac {b c d \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-c^2 x^2\right )}{2 x}+\frac {1}{2} i b c^2 d \left (2 \log (x)-\log \left (1+c^2 x^2\right )\right ) \]

[In]

Integrate[((d + I*c*d*x)*(a + b*ArcTan[c*x]))/x^3,x]

[Out]

-1/2*(d*(a + b*ArcTan[c*x]))/x^2 - (I*c*d*(a + b*ArcTan[c*x]))/x - (b*c*d*Hypergeometric2F1[-1/2, 1, 1/2, -(c^
2*x^2)])/(2*x) + (I/2)*b*c^2*d*(2*Log[x] - Log[1 + c^2*x^2])

Maple [A] (verified)

Time = 0.67 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.29

method result size
parts \(a d \left (-\frac {1}{2 x^{2}}-\frac {i c}{x}\right )+b d \,c^{2} \left (-\frac {i \arctan \left (c x \right )}{c x}-\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}+i \ln \left (c x \right )-\frac {1}{2 c x}-\frac {i \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\arctan \left (c x \right )}{2}\right )\) \(84\)
derivativedivides \(c^{2} \left (a d \left (-\frac {i}{c x}-\frac {1}{2 c^{2} x^{2}}\right )+b d \left (-\frac {i \arctan \left (c x \right )}{c x}-\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}+i \ln \left (c x \right )-\frac {1}{2 c x}-\frac {i \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\arctan \left (c x \right )}{2}\right )\right )\) \(90\)
default \(c^{2} \left (a d \left (-\frac {i}{c x}-\frac {1}{2 c^{2} x^{2}}\right )+b d \left (-\frac {i \arctan \left (c x \right )}{c x}-\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}+i \ln \left (c x \right )-\frac {1}{2 c x}-\frac {i \ln \left (c^{2} x^{2}+1\right )}{2}-\frac {\arctan \left (c x \right )}{2}\right )\right )\) \(90\)
parallelrisch \(-\frac {i \ln \left (c^{2} x^{2}+1\right ) x^{2} b \,c^{2} d -2 i c^{2} b d \ln \left (x \right ) x^{2}+x^{2} \arctan \left (c x \right ) b \,c^{2} d +2 i x \arctan \left (c x \right ) b c d -a \,c^{2} d \,x^{2}+2 i a c d x +b c d x +b d \arctan \left (c x \right )+a d}{2 x^{2}}\) \(97\)
risch \(-\frac {\left (2 b c d x -i b d \right ) \ln \left (i c x +1\right )}{4 x^{2}}+\frac {i d \left (-3 b \,c^{2} \ln \left (-7 c x -7 i\right ) x^{2}+4 b \,c^{2} \ln \left (-35 c x \right ) x^{2}-b \,c^{2} \ln \left (5 c x -5 i\right ) x^{2}-4 c x a -2 i b c x \ln \left (-i c x +1\right )-b \ln \left (-i c x +1\right )+2 i b c x +2 i a \right )}{4 x^{2}}\) \(123\)

[In]

int((d+I*c*d*x)*(a+b*arctan(c*x))/x^3,x,method=_RETURNVERBOSE)

[Out]

a*d*(-1/2/x^2-I*c/x)+b*d*c^2*(-I*arctan(c*x)/c/x-1/2/c^2/x^2*arctan(c*x)+I*ln(c*x)-1/2/c/x-1/2*I*ln(c^2*x^2+1)
-1/2*arctan(c*x))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.52 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=\frac {4 i \, b c^{2} d x^{2} \log \left (x\right ) - 3 i \, b c^{2} d x^{2} \log \left (\frac {c x + i}{c}\right ) - i \, b c^{2} d x^{2} \log \left (\frac {c x - i}{c}\right ) - 2 \, {\left (2 i \, a + b\right )} c d x - 2 \, a d + {\left (2 \, b c d x - i \, b d\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{4 \, x^{2}} \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))/x^3,x, algorithm="fricas")

[Out]

1/4*(4*I*b*c^2*d*x^2*log(x) - 3*I*b*c^2*d*x^2*log((c*x + I)/c) - I*b*c^2*d*x^2*log((c*x - I)/c) - 2*(2*I*a + b
)*c*d*x - 2*a*d + (2*b*c*d*x - I*b*d)*log(-(c*x + I)/(c*x - I)))/x^2

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (58) = 116\).

Time = 1.90 (sec) , antiderivative size = 182, normalized size of antiderivative = 2.80 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=i b c^{2} d \log {\left (35 b^{2} c^{5} d^{2} x \right )} - \frac {i b c^{2} d \log {\left (35 b^{2} c^{5} d^{2} x - 35 i b^{2} c^{4} d^{2} \right )}}{4} - \frac {3 i b c^{2} d \log {\left (35 b^{2} c^{5} d^{2} x + 35 i b^{2} c^{4} d^{2} \right )}}{4} + \frac {- a d + x \left (- 2 i a c d - b c d\right )}{2 x^{2}} + \frac {\left (- 2 b c d x + i b d\right ) \log {\left (i c x + 1 \right )}}{4 x^{2}} + \frac {\left (2 b c d x - i b d\right ) \log {\left (- i c x + 1 \right )}}{4 x^{2}} \]

[In]

integrate((d+I*c*d*x)*(a+b*atan(c*x))/x**3,x)

[Out]

I*b*c**2*d*log(35*b**2*c**5*d**2*x) - I*b*c**2*d*log(35*b**2*c**5*d**2*x - 35*I*b**2*c**4*d**2)/4 - 3*I*b*c**2
*d*log(35*b**2*c**5*d**2*x + 35*I*b**2*c**4*d**2)/4 + (-a*d + x*(-2*I*a*c*d - b*c*d))/(2*x**2) + (-2*b*c*d*x +
 I*b*d)*log(I*c*x + 1)/(4*x**2) + (2*b*c*d*x - I*b*d)*log(-I*c*x + 1)/(4*x**2)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.15 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=-\frac {1}{2} i \, {\left (c {\left (\log \left (c^{2} x^{2} + 1\right ) - \log \left (x^{2}\right )\right )} + \frac {2 \, \arctan \left (c x\right )}{x}\right )} b c d - \frac {1}{2} \, {\left ({\left (c \arctan \left (c x\right ) + \frac {1}{x}\right )} c + \frac {\arctan \left (c x\right )}{x^{2}}\right )} b d - \frac {i \, a c d}{x} - \frac {a d}{2 \, x^{2}} \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))/x^3,x, algorithm="maxima")

[Out]

-1/2*I*(c*(log(c^2*x^2 + 1) - log(x^2)) + 2*arctan(c*x)/x)*b*c*d - 1/2*((c*arctan(c*x) + 1/x)*c + arctan(c*x)/
x^2)*b*d - I*a*c*d/x - 1/2*a*d/x^2

Giac [F]

\[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=\int { \frac {{\left (i \, c d x + d\right )} {\left (b \arctan \left (c x\right ) + a\right )}}{x^{3}} \,d x } \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x))/x^3,x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.58 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.22 \[ \int \frac {(d+i c d x) (a+b \arctan (c x))}{x^3} \, dx=-\frac {\frac {d\,\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}{2}+\frac {d\,x\,\left (a\,c\,2{}\mathrm {i}+b\,c+b\,c\,\mathrm {atan}\left (c\,x\right )\,2{}\mathrm {i}\right )}{2}}{x^2}-\frac {d\,\left (b\,c^2\,\mathrm {atan}\left (c\,x\right )+b\,c^2\,\ln \left (c^2\,x^2+1\right )\,1{}\mathrm {i}-b\,c^2\,\ln \left (x\right )\,2{}\mathrm {i}\right )}{2} \]

[In]

int(((a + b*atan(c*x))*(d + c*d*x*1i))/x^3,x)

[Out]

- ((d*(a + b*atan(c*x)))/2 + (d*x*(a*c*2i + b*c + b*c*atan(c*x)*2i))/2)/x^2 - (d*(b*c^2*atan(c*x) + b*c^2*log(
c^2*x^2 + 1)*1i - b*c^2*log(x)*2i))/2